package com.uzai.console.enums;

/**
 * 公众号设备产品模块KEY
 */
public enum WxpubDeviceProductEnum {

    /**
     * 全部
     */
    ALL("all","套餐(返利+悠聊)", "['fl','uzaichat']"),

    /**
     * 返利
     */
    FL("fl","返利", "['fl']"),


    /**
     * 悠聊
     */
    UZAICHAT("uzaichat","悠聊", "['uzaichat']"),

    ;

    private String value;
    private String desc;
    private String codes;   //关联的产品
    WxpubDeviceProductEnum(String value, String desc, String codes) {
        this.value = value;
        this.desc = desc;
        this.codes = codes;
    }
    public String getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public String getCodes() { return codes;}

    public static WxpubDeviceProductEnum getValue(String value) {
        if (value == null) {
            return null;
        }
        for (WxpubDeviceProductEnum type: WxpubDeviceProductEnum.values()) {
            if (type.getValue().equals(value) ) {
                return type;
            }
        }
        return null;
    }
    public static String getDesc(String value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getDesc();
    }
    public static String getCodes(String value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getCodes();
    }
}
